package com.mobilottery.server;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.apache.log4j.Logger;

/**
 * Helper class for system initialization.
 * Should be defined to load on startup with higher priority in the web.xml of the web application  
 * @author fedor
 */
public class InitServlet extends HttpServlet 
{
	private static Logger logger = Logger.getLogger(InitServlet.class);
	
	private static final long serialVersionUID = 1L;
	
	public void init() throws ServletException
	{
		logger.info("initializing MobiLottery system");
		super.init();
		GameProvider.getInstance().init();
	}
	
	public void destroy() 
	{
		logger.info("shutting down MobiLottery system");
		super.destroy();
		GameProvider.getInstance().destroy();
	}
	
	
}
